package com.sdhs.think.modules.sys.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.sdhs.think.modules.sys.entity.Area;
import com.sdhs.think.modules.sys.service.AreaService;

@Controller
@RequestMapping(value ="/sys")
public class LoginController {
	@Autowired
	AreaService areaService;
	
	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@RequestMapping(value="/login")
	public String login(){
		Area area = this.areaService.get("2");
		logger.info(area.toString());
		return "modules/sys/sysLogin";
	}
	
	
	@RequestMapping(value="/login",method = RequestMethod.POST)
	public String login2(HttpServletRequest req){
		String name =req.getParameter("username");
		Subject subject = SecurityUtils.getSubject();
		System.out.println(subject);
		return "modules/sys/sysLogin";
	}

	@RequestMapping(value="/login11")
	public String login11(){
		Area area = this.areaService.get("2");
		System.out.println(area);
		System.out.println("login11");
		return "test1";
	}
}
